money = 10
goods = [
    ['a',2],
    ['b',3],
]
car = []
print(goods)
while True:
    choice = input('挑选商品（输入q退出）：')
    if choice == 'a':
        print("有")
        if money >=2:
            print("够")
            money -=2
            car.append(['a',2])
            print(money)
        else:
            print("不够")

    elif choice == 'b':
        if money >=3:
            print("够")
            money -=3
            car.append(['b',3])
            print("剩余{}元".format(money))
        else:
            print("不够")
    elif choice not in ['a','b','q']:
        print(" 商品 '{choice}' 不存在！请重新输入")
        continue
    elif choice == 'q':
         print('购物小条',car)
         print("购物结束")
         break